-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: rolling_* functions should not shrink window #7766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
can you add in tests for the rest of the rolling_* function? (I think make them work rather than raising, by returning all NaN). Not sure when that was changed (ideally if you can figure THAT out would be gr8, we could then reference that issue) |
Good point. rolling_min() and rolling_max() also have this problem. Am fixing those two, too.. |
It looks like this behavior was introduced as follows: |
looks pretty good! pls add a note in v0.15.0.txt - put under API changes, as it technically now will work correctly. I would do a small example their to illustrate the 'new' behavior. |
I added a note to v0.15.0.txt, but afraid don't know how to "test" it. Let me know if I did something wrong... |
- :func:`rolling_min`, :func:`rolling_max`, :func:`rolling_cov`, and :func:`rolling_corr` | ||
now return objects with all ``NaN``s when ``len(arg) < min_periods <= window`` | ||
(like all other rolling functions do) rather than producing an error message. | ||
For example, ``rolling_min(Series([1.]*4), min_periods=5, window=10)`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u put an ipython block (look at examples I. the docs for how to do this). u just need to show the behavior
You create a block something like this (obviously NOT the content). and its like an ipython session.
|
OK. Will try to give a more explicit example tomorrow or over the weekend. BTW, is there an easy way for me to preview what the results will look like? |
Thank you very much guys! Appreciate all the work. |
@seth-p you can build the docs see here: http://pandas.pydata.org/developers.html#contributing-to-the-documentation (it will be build in the dev docs when its merged as well). |
@seth-p can you update the docs as discussed above...thxs |
@jreback, I tried to follow http://pandas.pydata.org/developers.html#contributing-to-the-documentation, but am stumped by the error below. Any idea what that's about? Is there anything else I need to install besides sphinx? Apologies if I'm missing something obvious...
|
use sphinx 1.1.3 (something is broken in more recent version) |
Will give it a shot, thanks. Note that README.rst say: "Building the docs with Sphinx version 1.2 is broken. Use the latest stable version (1.2.1) or the older 1.1.3.". This suggests v1.2.2 should work... |
I get the same error with Sphinx v1.1.3. :-( |
maybe look thru some issues about building on docs on windows |
Looks like I have the exact same error @phaebz described on #5530 (comment). Afraid I can't make heads or tails out of the discussion there... |
oh thought u were building on py 2.7 ? on windows ok no biggie just edit and I'll take a look at your docs |
I'm using 3.4.1 (64-bit, if that matters) on Windows. OK, will commit changes soon. Sorry for the inconvenience... |
I checked in the updated docs. Travis build is still running... Let me know if you had something else in mind for the docs. |
merged via dbb6185 |
thanks! |
yes, it is a python 3 issue what you got when building the docs. I should update the README to mention that for now it only fully works for python 2 (or better fix it on python 3) |
Closes #7764.